package me.banxi.mia.account.email;

import org.springframework.mail.MailSender;
import org.springframework.mail.SimpleMailMessage;

public abstract class SimpleMailSender {

	protected abstract MailSender getMailSender();
	
	public final void sendMessage(String to,String subject,String text){
		SimpleMailMessage msg = new SimpleMailMessage();
		msg.setTo(to);
		msg.setSubject(subject);
		msg.setText(text);
		
		MailSender sender = getMailSender();
		sender.send(msg);
	}
}
